package cn.net.ecode.constant;

/**
 * @ClassName YesOrNoEnum
 * @Description 登录类型枚举类
 * @Author AlanShelby
 * @Date 2019/8/27 0027 11:21
 * @Version 1.0
 */
public enum LoginTypeEnum {
    PASSWORD(1, "密码登录"),
    VALIDATE_CODE(2, "短信验证码登录");

    private Integer code;

    private String message;

    LoginTypeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer value) {
        if (value == null) {
            return "";
        } else {
            for (LoginTypeEnum ms : LoginTypeEnum.values()) {
                if (ms.getCode() == value) {
                    return ms.getMessage();
                }
            }
            return "";
        }
    }
}
